package serves.Impl;

import Util.PageUtil;
import bean.CClass;
import dao.Impl.classDaoImpl;
import dao.classDao;
import serves.classSev;

import java.util.List;

public class classSevImpl implements classSev {
    classDao cd = new classDaoImpl();

    @Override
    public List<CClass> classlist() {
        return cd.classlist();
    }

    @Override
    public PageUtil<CClass> ListByPage(int pageNo, int pageSize, String classname) {
        List<CClass> bs = cd.ListByPage(pageNo, pageSize, classname);
        System.out.println("bs.size() = " + bs.size());
        int count = cd.getListCount(classname);
        PageUtil<CClass> cClassList = new PageUtil<>(bs, pageNo, pageSize, count);
        return cClassList;
    }

    @Override
    public boolean add(CClass cClass) {
        return cd.add(cClass);
    }

    @Override
    public boolean delete(CClass cClass) {
        return false;
    }

    @Override
    public CClass find(CClass cClass) {
        return cd.find(cClass);
    }

    @Override
    public boolean altArea(CClass cClass) {
        return cd.altArea(cClass);
    }

    @Override
    public boolean alter(CClass cClass ){
        return cd.alter(cClass);
    }

}
